package com.acegear.horizon.domain.events;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import redis.clients.jedis.Jedis;

/**
 * Created by wangsike on 2016/12/12.
 */
@Service
public class EventFactory {

    @Autowired
    private Jedis jedis;

    @Value("${horizon.domain.event.idKey}")
    private String eventIdKey;

    public Long nextEventId() {
        return jedis.incr(eventIdKey);
    }
}
